home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 125
/
Freelog_MarsAvril2015_No125.iso
/
Musique
/
Quod Libet
/
quodlibet-3.3.0-installer.exe
/
bin
/
quodlibet
/
player
/
__init__.pyc
(
.txt
)
next >
Wrap
Python Compiled Bytecode
|
2014-12-31
|
2KB
|
52 lines
# Source Generated with Decompyle++
# File: in.pyc (Python 2.7)
from quodlibet import const
from quodlibet import util
class PlayerError(Exception):
'''Error raised by player loading/initialization and emitted by the
error signal during playback.
Both short_desc and long_desc are meant for displaying in the UI.
They should be unicode.
'''
def __init__(self, short_desc, long_desc = None):
self.short_desc = short_desc
self.long_desc = long_desc
def __unicode__(self):
return self.short_desc + u'\n' + self.long_desc if self.long_desc else u''
def __str__(self):
return unicode(self).encode('utf-8')
def __repr__(self):
return '%s(%r, %r)' % (type(self).__name__, repr(self.short_desc), repr(self.long_desc))
def init(backend_name):
'''Imports the player backend module for the given name.
Raises PlayerError if the import fails.
the module provides the following functions:
init(librarian) -> new player instance
'''
modulename = 'quodlibet.player.' + backend_name
try:
backend = __import__(modulename, { }, { }, 'quodlibet.player')
except ImportError:
if const.DEBUG:
util.print_exc()
raise PlayerError(_('Invalid audio backend'), _("The audio backend '%(backend-name)s' could not be loaded.") % {
'backend-name': backend_name })
return backend